<script src="${rc.getContextPath()}/manage/js/jquery.jgantt.js?v=${ver}"
	type="text/javascript"></script>
<style>
.jgantt .date, .jgantt .priority {
	float: left;
	border: transparent;
	border-left: 1px solid transparent;
	border-right: 1px solid transparent;
}

.jgantt .inputDateButton {
	float: right;
	margin-top: -1px;
	height: 23px;
	margin-right: -1px;
	height: 23px;
	margin-top: -1px;
	height: 23px;
}

.jgantt .date.focus, .jgantt .priority.focus {
	border: 1px solid #289be5;
}

.jgantt .priority {
	width: 33px;
}

.dateInputCell {
	text-indent: 6px;
}

.jgantt .warning-icon {
	background: url("${rc.getContextPath()}/images/warning-icon.png");
	height: 16px;
	width: 16px;
	cursor: pointer;
	display: none;
	position: absolute;
	top: 3px;
	left: 50%;
	margin-left: -8px;
}

.jgantt-bar {
	background: url("${rc.getContextPath()}/manage/styles/basicColor/basicColor.png");
}

.bar-warning {
    position: absolute;
    width: 222px;
    border: 1px solid #D8DFE5;
    z-index: 12;
    background: #EFF2F7;
    text-align: left;
    text-indent: 3px;
    line-height: 20px;
    height: 42px;
    left: 50%;
    margin-left: -9px;
    display: none;
}

.bar-warning-under {
    top: 24px;
}

.bar-warning-upper {
    bottom: 24px;
}

.arrow {
    background: url("${rc.getContextPath()}/images/dialogarrow.png");
    position: absolute; 
}

.bar-warning-under .arrow {
    left: 1px;
    top: -8px;
    width: 16px;
    height: 8px;
    background-position: 0px -55px;
}
   
.bar-warning-upper .arrow {
    left: 1px;
    bottom: -8px;
    width: 16px;
    height: 8px;
    background-position: 0px -43px;
}

#separateOperationTask {
	width: 100% !important;
}

</style>
<div layoutH="-2" style="margin-top: -2px;" class="pageContent">
	<div class="panelBar headBar">
		<ul class="toolBar">
			<li class="">
				<a id="arrangeSelected" href="javascript:void(0);" title="无工作日历或产能无法排产，确认重排所选生产管理号？" class="rearrange">
					<span>重排所选生产管理号</span>
				</a>
			</li>
			<li class="">
				<a id="arrangeAll" href="javascript:void(0);" title="无工作日历或产能无法排产，确认重排全部生产管理号？" class="rearrangeAll">
					<span>重排全部</span>
				</a> 
			</li>
			<li>
				<a id="issueOperationTasks" target="" href="javascript:void(0);" title="下达已经排产完毕的生产管理号？" class="rel">
					<span>下达</span>
				</a>
			</li>
			<li>
				<a id="releaseOperationTasks" href="javascript:void(0);" title="撤销下达所选订单管理号？" class="unRel">
					<span>撤销下达</span>
				</a>
			</li>
			<li>
				<label style="margin-left: 5px; line-height: 24px;">
					<input id="updateNextBar" type="checkbox" checked="checked">
					调整时联动后续任务
				</label>
			</li>
			<li style="border-width: 0px;" >
				<label style="margin-left: 5px; line-height: 24px;">
					<input id="displayAll" type="checkbox" checked="checked">
					显示全部
				</label>
			</li>
			<li style="float: right; margin-right: 10px; border-width: 0px;" class="">
				<div class="buttonActiveGrey">
					<div class="buttonContent">
						<button id="history_back">返回</button>
					</div>
				</div>
			</li>
			<li style="float: right; margin-right: 10px;" class="">
				<div class="buttonActive">
					<div class="buttonContent">
						<button id="saveOperationTasks">保存</button>
					</div>
				</div>
			</li>
		</ul>
	</div>
	<div id="jGantt" layouth="31"></div>
</div>
<#include "/pp/orderArrangement/separateTask.html">
<script src = "${rc.getContextPath()}/manage/js/businessJs/arrangeOperationTask.js" type="text/javascript"/>
<script type="text/javascript">
$(function() {
	var $page = DWZ.context(), start = '${start}', end = '${end!""}', orderNums = '${orderNums}', controlNums = '${controlNums}';
	var $gantt = $('#jGantt', $page).height($page.closest('.layoutBox').height() - 31);
	if (!end) {
		end = new Date().formatDate('yyyy-MM-dd');
	}
	var endDate = end.parseDate('yyyy-MM-dd');
	endDate.setMonth(endDate.getMonth() + 2);
	end = endDate.formatDate('yyyy-MM-dd');
	
	var ajaxCallBack = function() {
		navTab.openTab('${navTabId}', '${rc.getContextPath()}/manage/operationArrangement/operationArrangement_list_page', {
			data: {
				navTabId: '${navTabId}',
				startDate: '${startDate}',
				endDate: '${endDate}',
				orderType: '${orderType}',
				orderNums: orderNums,
				controlNums: controlNums
			},
			title: '<@label key="operationArrange.C">工序排产</@label>',
			fresh: true,
			external: false
		});
	};
	
	arrangeOperationTask(start, end, orderNums, controlNums, hostUrl, ajaxCallBack);

	$('#history_back', $page).click(function() {
		alertMsg.confirm('确认返回吗？', {
			okCall: function() {
				navTab.openTab('${navTabId}', hostUrl + '/operationArrangement/unarrangedControl_list_page', {
					data: {
						navTabId: '${navTabId}',
						startDate: '${startDate}',
						endDate: '${endDate}',
						orderType: '${orderType}'
					},
					title: '工序排产',
					fresh: true,
					external: false
				});
				return false;
			}
		});
	});
	
	$('#displayAll', $page).change(function(){
		if (this.checked) {
			var $rows = $gantt.find('.dataRow').show();
			$gantt.find('.jgantt-right .content').height($rows.length * 24);
		} else {
			var $rows = $gantt.find('.dataRow[readonly]').hide();
			$gantt.find('.jgantt-right .content').height($gantt.find('.dataRow:not([readonly])').length * 24);
		}
	});
});
</script>